package model;

import common.DataManager;

/**
 * @author Bill
 * Repairs a portion of the players health 
 *
 */
public class RepairUpgrade extends Upgrade{
	
	private static final int INITIAL_UPGRADE_AMOUNT = 20;
	private static final int COST = 100;
	
	private float upgradeAmount;
	
	//HealthUpgrade without player
	public RepairUpgrade(){
		super("Repair Upgrade", DataManager.REPAIR_UPGRADE, COST);
		upgradeAmount = INITIAL_UPGRADE_AMOUNT;
	}
	public RepairUpgrade( Player player){
		super("Repair Upgrade", DataManager.REPAIR_UPGRADE, COST);
		this.player = player;
		this.upgradeAmount = INITIAL_UPGRADE_AMOUNT;
	}
	
	@Override
	public void applyUpgrade() {
		float health = player.getHealth();
		player.setHealth(health+upgradeAmount);
		System.out.println("Player max health is " + player.getMaxHealth());
	}
	@Override
	public String getDescription() {
		return "Restores 20 health";
	}
}
